<template>
    <div class="video">


        <!-- 作品显示区域 -->
        <div class="videoBoke">
            <div class="videoBokeWord">
                <p>我的博客</p>
            </div>
            <div class="videoBokeContent" >
                <div class="boke" v-for="(item, index) in timuList" :key="item.id">
                    <span class="bokeTitle"><a href="#">{{item.title}}</a></span>
                    <span class="bokeContent">{{item.text}}</span>
                    <div class="date_shanchu">
                        <span class="bokeDate">{{item.time}}</span>
                        <span class="shanchu">
                      <button class="el_button" @click="shanchu(index)">删除</button>
                    </span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
    import {request} from "../../network/request";

    export default {
        data(){
            return{
                timuList:[]
            }
        },

        methods:{
            shanchu(num){
                console.log(num);
                for (let i = 0; i < this.timuList.length; i++) {
                    if(this.timuList[i].id === num){
                        this.timuList.splice(i,1);
                    }

                }

            }
        },

        created() {
            request({
                url:"/getBlogByUserId",
                method: "get",
                params:{
                    userId:parseInt(sessionStorage.getItem("userId"))
                }
            }).then(res=>{
                console.log(res.data);
                this.timuList = res.data;

            }).catch(err=>{
                console.log(err);
            });
        }

    }
</script>

<style>

    .video{
        width: 1000px;
        height: 1200px;
        background-color: white;
        margin: 0 auto;
        position: relative;

    }

    .video:after{
        clear: both;
    }

    .videoType{
        width: 175px;       height: 600px;
        float: left;
        display: block;
    }

    .videoType ul{
        list-style: none;
    }

    .videoType li{
        width: 175px;   height: 50px;
        line-height: 50px;
        margin-left: 0;

    }

    .videoType li:hover{
        background-color: skyblue;
    }


    .a1{
        display: inline-block;
        width: 60px;    height: 30px;
        line-height: 30px;
        margin-right: 10px;

        text-decoration: none;
        color: black;
    }

    .span2{
        margin-left: 30px;
        margin-right: 20px;
    }
    ::-webkit-scrollbar {
        width:5px;

    }

    /* 滚动槽 */
    ::-webkit-scrollbar-track {
        border-radius:5px;
    }

    /* 滚动条滑块 */
    ::-webkit-scrollbar-thumb {
        border-radius:10px;
        background: #e8eaf1;
    }
    .videoBoke{
        width: 800px;
        height: 1500px;
        float: left;
        overflow: auto;
        background-color: #fff;

    }


    .videoBokeWord{
        width: 100%;    height: 20px;
        margin-bottom: 15px;
    }

    .videoBokeWord p{
        float: left;
        margin-left: 25px;
    }

    .videoBokeContent{
        width: 100%;    height: 500px;
        margin: 0 auto;
        padding-left: 25px;
    }

    .boke{
        width: 100%;    height: 135px;
        text-align: left;
        padding-left: 25px;
        overflow: hidden;
        padding-bottom: 3px;
    }

    .boke:hover{
        background-color: rgb(249,250,252);
        transition: 1s;
    }

    .bokeTitle{
        height: 35px;
        line-height: 35px;
        display: block;
        overflow: hidden;
    }

    .bokeTitle a{
        font-size: 18px;
        color: #555666;
        font-weight: 500;
        text-decoration: none;
        cursor:pointer;
    }

    .bokeTitle a:hover{
        color: rgb(252,85,49);
    }

    .boke:hover .shanchu{
        display: block;
    }

    /* .boke:hover .bokeContent{
        color: rgb(252,85,49);
    } */

    .bokeContent{
        width: 96%;        height: 65px;
        text-indent: 2em;
        font-size: 10px;
        color: rgb(153,154,170);
        overflow: hidden;
        display: block;
    }

    .date_shanchu{
        width: 95%;        height: 25px;
        line-height: 20px;
        margin-top: 10px;
    }

    .bokeDate{
        font-size: 12px;
        color: orange;
        float: left;
    }

    .shanchu{
        width: 100px;       height: 20px;
        float: right;
        display: none;
    }

    .el_button{
        width: 60px;       height: 20px;
        font-size: 8px;
        text-align: center;
        background-color: rgb(245,108,108);
        border-radius: 50px;
        color: rgb(255,255,255);
        border: 0;
        cursor: pointer;
        float: right;
    }

</style>